<?php

abstract class Engine_Action_ControllerAbstract
{

protected $get = array();
protected $view; //obj
protected $auth;  //obj

   
    public function setAuthConfig() 
    {   
        $this->auth = Auth_Model::getInstance();
        $this->view->isReg = $this->auth->getIsReg();
        $this->view->currentUser = $this->auth->getCurrentUser();
    }
   
    public function setView ( View $view )
    {
        $this->view = $view;
        return $this;                                        
    } 

    public function setArgs($get = null) 
    { 
        if(null != $get){
            $this->get = $get;
        }
        return $this;
    }

    // модель со служебными данными, вызывается из action
    public function setInfoModel($pageTitle)
    {   
        $infoModel = new Info_Model($pageTitle);
        $this->view->info = array(
            'title'       => $infoModel->getPageTitle(),
            'year'        => $infoModel->getYear(),
            'author'      => $infoModel->getAuthor(),
            'siteName'    => $infoModel->getSiteName(),
            'siteVersion' => $infoModel->getSiteVersion(),
        );   
    }
}
